<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>股票分析</title>
<style>
body {
	background: #fff;
	font-size: 12px;
	font-family: Arial;
	color: #666;
}

#tab1 {
	border-collapse: collapse;
}

#tab1 td {
	border: #000000 1px solid;
}
</style>

</head>

<body>

<table id="tab1">
	<tr>
        <td colspan="30">原始</td>
        <td colspan="20">偏离</td>
    </tr>
    <tr>
        <td colspan="30">&nbsp;</td>
        <td colspan="9">价格分析</td>
        <td colspan="5">规模分析</td>
        <td colspan="5">价值分析</td>
    </tr>
    <tr>
        <td>名称[0][1]</td>
        <td>最新价[2]</td>
        <td>涨跌幅[3]</td>
        <td>涨跌额[4]</td>
        <td>成交额(万)[5]</td>
        <td>今开盘[7]</td>
        <td>昨收盘[8]</td>
        <td>最高价[9]</td>
        <td>最低价[10]</td>
        <td>换手[11]</td>
        <td>振幅[12]</td>
        <td>量比[13]</td>
        <td>一年最高[14]</td>
        <td>一年最低[15]</td>
        <td>1周涨跌[16]</td>
        <td>4周涨跌[17]</td>
        <td>13周涨跌[18]</td>
        <td>52周涨跌[20]</td>
        <td>今年以来涨跌[21]</td>
        <td>流通市值(亿)[22]</td>
        <td>总市值(亿)[23]</td>
        <td>流通A股(万)[24]</td>
        <td>总股本[25]</td>
        <td>主营收入(亿)[26]</td>
        <td>净利润(亿)[27]</td>
        <td>市盈率LYR[28]</td>
        <td>市盈率TTM[29]</td>
        <td>市净率[30]</td>
        <td>每股收益[31]</td>
        <td>每股净资产[32]</td>
        <td>最新价</td>
        <td>涨跌幅</td>
        <td>一年最高</td>
        <td>一年最低</td>
        <td>1周涨跌</td>
        <td>4周涨跌</td>
        <td>13周涨跌</td>
        <td>52周涨跌</td>
        <td>今年以来涨跌</td>
        <td>流通市值</td>
        <td>总市值</td>
        <td>总股本</td>
        <td>主营收入</td>
        <td>净利润</td>
        <td>市盈率LYR</td>
        <td>市盈率TTM</td>
        <td>市净率</td>
        <td>每股收益</td>
        <td>每股净资产</td>
    </tr>
  

<?php
//header("Content-Type:text/html; charset=utf-8");
$type = isset($_GET['type']) ? $_GET['type'] : 0;
$path = $tablename = '';
switch ($type) {
    case 1: //房产
        $path = 'http://quotes.money.163.com/data/sort/item=ZJ,key=SYMBOL,page=1,count=200,node=05,orderStyle=ASC.html';
        $tablename = 'house';
        break;
    case 2: //金融
        $path = "http://quotes.money.163.com/data/sort/item=ZI,key=SYMBOL,page=1,count=200,node=05,orderStyle=ASC.html";
        $tablename = 'bank';
        break;
    case 3: //计算机
        $path = "http://quotes.money.163.com/data/sort/item=ZG83,key=SYMBOL,page=1,count=200,node=05,orderStyle=ASC.html";
        $tablename = 'computer';
        break;
    case 4: //金属钢铁
        $path = "http://quotes.money.163.com/data/sort/item=ZC65,key=SYMBOL,page=1,count=200,node=05,orderStyle=ASC.html";
        $tablename = 'steel';
        break;
    default:
        $path = 'http://quotes.money.163.com/data/sort/item=ZJ,key=SYMBOL,page=1,count=200,node=05,orderStyle=ASC.html';
        $tablename = 'house';
}

function dealMessCode($s){
    $s = trim(str_replace(array('dataArr1 = ','diy.loadDataFinish1();',';','\''),array('','','','"'),$s));
    //$s = preg_replace('/(-?[^\D]+\.?[^\D]+)E(-\d+)/','"$1E$2"',$s);
    $s = preg_replace('/(-?[^\D]+\.?[^\D]*)E(-\d+)/', 0, $s);
    $s = iconv("GB2312", "UTF-8", $s);
    return $s;
}

function myCurl ($url)
{
    $headers[] = 'Host:quotes.money.163.com';
    $headers[] = 'Connection: Keep-Alive';
    $user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)";
    $process = curl_init($url);
    curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($process, CURLOPT_HEADER, 0);
    curl_setopt($process, CURLOPT_USERAGENT, $user_agent);
    curl_setopt($process, CURLOPT_TIMEOUT, 30);
    curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
    $return = curl_exec($process);
    curl_close($process);
    return $return;
}
//$s = file_get_contents($path);
include_once dirname(__FILE__) . "/Snoopy.class.php";
include_once dirname(__FILE__) . "/config.php";
$snoopy = new Snoopy();
$snoopy->proxy_host = "quotes.money.163.com";
$snoopy->agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)";
$snoopy->referer = "http://quotes.money.163.com/market/diy.html";
if ($snoopy->fetch($path)) {
    $s = $snoopy->results;
} else {
    echo "error fetching document: " . $snoopy->error . "\n";
    exit('抓取数据失败，请重试');
}
$data = json_decode(dealMessCode($s));
if (count($data) == 0) {
    $s = myCurl($path);
    $data = json_decode(dealMessCode($s));
    if (count($data) == 0) {
        exit('不好! 数据是空的...');
    }
}

//剔除B股
$aData = array();
foreach ($data as $k => $v) {
    if (strpos($v[1], 'B') === false) {
        $aData[] = $v;
    }
}
$aCount = count($aData);
//记录于数据库中
if(isset($_GET['db']) && $_GET['db'] == 'yes'){
    $date = date('Y-m-d');
    $mysqli = new mysqli($dbConf['host'], $dbConf['username'], $dbConf['passwd'], $dbConf['dbname']);
    if ($mysqli->connect_error) {
        die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
    }
        /* change character set to utf8 */
    if (!$mysqli->set_charset("utf8")) {
        printf("Error loading character set utf8: %s\n", $mysqli->error);
    }
    $sql = "select count(1) from $tablename where rdate = '$date'";
    if ($result = $mysqli->query($sql)) {
        while ($row = $result->fetch_row()) {
            if ($row[0] > 0) {
                exit('今日数据已经保存于数据库，请勿重复保存！');
            }
        }
        $result->close();
    } 
    foreach($aData as $k => $v){
        array_pop($v);
        $cols = "'".implode("','",$v)."'";
        $sql = "insert into $tablename values(null,$cols,'$date')";
        if($r = $mysqli->query($sql)){
            //$r->close();
        }
    }
    $mysqli->close();
    exit('保存数据库成功.');
}
$sum_bookvalue = 0; //总市值
$sum_lastest_price = 0;
$sum_up_down = 0;
$sum_1year_hightest = 0;
$sum_1year_lowest = 0;
$sum_1week_updown = 0;
$sum_4week_updown = 0;
$sum_13week_updown = 0;
$sum_52week_updown = 0;
$sum_thisyear_updown = 0;
$sum_current_bookvalue = 0;
$sum_share = 0;
$sum_revenue = 0;
$sum_net_profit = 0;
$sum_pe_ratio_lyr = 0;
$sum_pe_ratio_ttm = 0;
$sum_pb_ratio = 0;
$sum_eps = 0;
$sum_net_asset_per = 0;

//每列求总
foreach ($aData as $k => $v) {
    $sum_bookvalue += $v[23];
    $sum_lastest_price += $v[2];
    $sum_up_down += $v[3];
    $sum_1year_hightest += $v[14];
    $sum_1year_lowest += $v[15];
    $sum_1week_updown += 0;
    $sum_4week_updown += $v[17];
    $sum_13week_updown += $v[18];
    $sum_52week_updown += $v[20];
    $sum_thisyear_updown += $v[21];
    $sum_current_bookvalue += $v[22];
    $sum_share += $v[25];
    $sum_revenue += $v[26];
    $sum_net_profit += $v[27];
    $sum_pe_ratio_lyr += $v[28];
    $sum_pe_ratio_ttm += $v[29];
    $sum_pb_ratio += $v[30];
    $sum_eps += $v[31];
    $sum_net_asset_per += $v[32];
}
/*
echo '$sum_bookvalue='.$sum_bookvalue .'<br>';//总市值
echo '$sum_lastest_price='.$sum_lastest_price .'<br>';
echo '$sum_up_down='.$sum_up_down .'<br>';
echo '$$sum_1year_hightest='.$sum_1year_hightest .'<br>';
echo '$$sum_1year_lowest='.$sum_1year_lowest .'<br>';
echo '$$sum_1week_updown='.$sum_1week_updown .'<br>';
echo '$$sum_4week_updown='.$sum_4week_updown .'<br>';
echo '$$sum_13week_updown='.$sum_13week_updown .'<br>';
echo '$$sum_52week_updown='.$sum_52week_updown .'<br>';
echo '$$sum_thisyear_updown='.$sum_thisyear_updown .'<br>';
echo '$$sum_current_bookvalue='.$sum_current_bookvalue .'<br>';
echo '$$sum_share='.$sum_share .'<br>';
echo '$$sum_revenue='.$sum_revenue .'<br>';
echo '$$sum_net_profit='.$sum_net_profit .'<br>';
echo '$$sum_pe_ratio_lyr='.$sum_pe_ratio_lyr .'<br>';
echo '$$sum_pe_ratio_ttm='.$sum_pe_ratio_ttm .'<br>';
echo '$$sum_pb_ratio='.$sum_pb_ratio .'<br>';
echo '$$sum_eps='.$sum_eps .'<br>';
echo '$$sum_net_asset_per='.$sum_net_asset_per .'<br>';
*/
//各个市值权重
foreach ($aData as $k => $v) {
    //$aData[$k]['weight'] = $v[23]/$sum_bookvalue;
    $aData[$k]['weight'] = 1;
    $aData[$k]['lastest_price'] = $v[2] * $aData[$k]['weight'];
    $aData[$k]['up_down'] = $v[3] * $aData[$k]['weight'];
    $aData[$k]['1year_hightest'] = $v[14] * $aData[$k]['weight'];
    $aData[$k]['1year_lowest'] = $v[15] * $aData[$k]['weight'];
    $aData[$k]['1week_updown'] = $v[16] * $aData[$k]['weight'];
    $aData[$k]['4week_updown'] = $v[17] * $aData[$k]['weight'];
    $aData[$k]['13week_updown'] = $v[18] * $aData[$k]['weight'];
    $aData[$k]['52week_updown'] = $v[20] * $aData[$k]['weight'];
    $aData[$k]['thisyear_updown'] = $v[21] * $aData[$k]['weight'];
    $aData[$k]['current_bookvalue'] = $v[22] * $aData[$k]['weight'];
    $aData[$k]['share'] = $v[25] * $aData[$k]['weight'];
    $aData[$k]['revenue'] = $v[26] * $aData[$k]['weight'];
    $aData[$k]['net_profit'] = $v[27] * $aData[$k]['weight'];
    $aData[$k]['pe_ratio_lyr'] = $v[28] * $aData[$k]['weight'];
    $aData[$k]['pe_ratio_ttm'] = $v[29] * $aData[$k]['weight'];
    $aData[$k]['pb_ratio'] = $v[30] * $aData[$k]['weight'];
    $aData[$k]['eps'] = $v[31] * $aData[$k]['weight'];
    $aData[$k]['net_asset_per'] = $v[32] * $aData[$k]['weight'];
}
//print_r($aData);
$sum_weight_lastest_price = 0;
$sum_weight_up_down = 0;
$sum_weight_1year_hightest = 0;
$sum_weight_1year_lowest = 0;
$sum_weight_1week_updown = 0;
$sum_weight_4week_updown = 0;
$sum_weight_13week_updown = 0;
$sum_weight_52week_updown = 0;
$sum_weight_thisyear_updown = 0;
$sum_weight_current_bookvalue = 0;
$sum_weight_share = 0;
$sum_weight_revenue = 0;
$sum_weight_net_profit = 0;
$sum_weight_pe_ratio_lyr = 0;
$sum_weight_pe_ratio_ttm = 0;
$sum_weight_pb_ratio = 0;
$sum_weight_eps = 0;
$sum_weight_net_asset_per = 0;
foreach ($aData as $k => $v) {
    $sum_weight_lastest_price += $v['lastest_price'];
    $sum_weight_up_down += $v['up_down'];
    $sum_weight_1year_hightest += $v['1year_hightest'];
    $sum_weight_1year_lowest += $v['1year_lowest'];
    $sum_weight_1week_updown += $v['1week_updown'];
    $sum_weight_4week_updown += $v['4week_updown'];
    $sum_weight_13week_updown += $v['13week_updown'];
    $sum_weight_52week_updown += $v['52week_updown'];
    $sum_weight_thisyear_updown += $v['thisyear_updown'];
    $sum_weight_current_bookvalue += $v['current_bookvalue'];
    $sum_weight_share += $v['share'];
    $sum_weight_revenue += $v['revenue'];
    $sum_weight_net_profit += $v['net_profit'];
    $sum_weight_pe_ratio_lyr += $v['pe_ratio_lyr'];
    $sum_weight_pe_ratio_ttm += $v['pe_ratio_ttm'];
    $sum_weight_pb_ratio += $v['pb_ratio'];
    $sum_weight_eps += $v['eps'];
    $sum_weight_net_asset_per += $v['net_asset_per'];
}
$avg_lastest_price = $sum_weight_lastest_price / $aCount;
$avg_up_down = $sum_weight_up_down / $aCount;
$avg_1year_hightest = $sum_weight_1year_hightest / $aCount;
$avg_1year_lowest = $sum_weight_1year_lowest / $aCount;
$avg_1week_updown = $sum_weight_1week_updown / $aCount;
$avg_4week_updown = $sum_weight_4week_updown / $aCount;
$avg_13week_updown = $sum_weight_13week_updown / $aCount;
$avg_52week_updown = $sum_weight_52week_updown / $aCount;
$avg_thisyear_updown = $sum_weight_thisyear_updown / $aCount;
$avg_current_bookvalue = $sum_weight_current_bookvalue / $aCount;
$avg_share = $sum_weight_share / $aCount;
$avg_revenue = $sum_weight_revenue / $aCount;
$avg_net_profit = $sum_weight_net_profit / $aCount;
$avg_pe_ratio_lyr = $sum_weight_pe_ratio_lyr / $aCount;
$avg_pe_ratio_ttm = $sum_weight_pe_ratio_ttm / $aCount;
$avg_pb_ratio = $sum_weight_pb_ratio / $aCount;
$avg_eps = $sum_weight_eps / $aCount;
$avg_net_asset_per = $sum_weight_net_asset_per / $aCount;
//计算方差
$sum_variance_lastest_price = 0;
$sum_variance_up_down = 0;
$sum_variance_1year_hightest = 0;
$sum_variance_1year_lowest = 0;
$sum_variance_1week_updown = 0;
$sum_variance_4week_updown = 0;
$sum_variance_13week_updown = 0;
$sum_variance_52week_updown = 0;
$sum_variance_thisyear_updown = 0;
$sum_variance_current_bookvalue = 0;
$sum_variance_share = 0;
$sum_variance_revenue = 0;
$sum_variance_net_profit = 0;
$sum_variance_pe_ratio_lyr = 0;
$sum_variance_pe_ratio_ttm = 0;
$sum_variance_pb_ratio = 0;
$sum_variance_eps = 0;
$sum_variance_net_asset_per = 0;
foreach ($aData as $k => $v) {
    $sum_variance_lastest_price += pow($v['lastest_price'] - $avg_lastest_price, 2);
    $sum_variance_up_down += pow($v['up_down'] - $avg_up_down, 2);
    $sum_variance_1year_hightest += pow($v['1year_hightest'] - $avg_1year_hightest, 2);
    $sum_variance_1year_lowest += pow($v['1year_lowest'] - $avg_1year_lowest, 2);
    $sum_variance_1week_updown += pow($v['1week_updown'] - $avg_1week_updown, 2);
    $sum_variance_4week_updown += pow($v['4week_updown'] - $avg_4week_updown, 2);
    $sum_variance_13week_updown += pow($v['13week_updown'] - $avg_13week_updown, 2);
    $sum_variance_52week_updown += pow($v['52week_updown'] - $avg_52week_updown, 2);
    $sum_variance_thisyear_updown += pow($v['thisyear_updown'] - $avg_thisyear_updown, 2);
    $sum_variance_current_bookvalue += pow($v['current_bookvalue'] - $avg_current_bookvalue, 2);
    $sum_variance_share += pow($v['share'] - $avg_share, 2);
    $sum_variance_revenue += pow($v['revenue'] - $avg_revenue, 2);
    $sum_variance_net_profit += pow($v['net_profit'] - $avg_net_profit, 2);
    $sum_variance_pe_ratio_lyr += pow($v['pe_ratio_lyr'] - $avg_pe_ratio_lyr, 2);
    $sum_variance_pe_ratio_ttm += pow($v['pe_ratio_ttm'] - $avg_pe_ratio_ttm, 2);
    $sum_variance_pb_ratio += pow($v['pb_ratio'] - $avg_pb_ratio, 2);
    $sum_variance_eps += pow($v['eps'] - $avg_eps, 2);
    $sum_variance_net_asset_per += pow($v['net_asset_per'] - $avg_net_asset_per, 2);
}
//平均方差
$avg_lastest_price = $sum_variance_lastest_price / $aCount;
$avg_up_down = $sum_variance_up_down / $aCount;
$avg_1year_hightest = $sum_variance_1year_hightest / $aCount;
$avg_1year_lowest = $sum_variance_1year_lowest / $aCount;
$avg_1week_updown = $sum_variance_1week_updown / $aCount;
$avg_4week_updown = $sum_variance_4week_updown / $aCount;
$avg_13week_updown = $sum_variance_13week_updown / $aCount;
$avg_52week_updown = $sum_variance_52week_updown / $aCount;
$avg_thisyear_updown = $sum_variance_thisyear_updown / $aCount;
$avg_current_bookvalue = $sum_variance_current_bookvalue / $aCount;
$avg_share = $sum_variance_share / $aCount;
$avg_revenue = $sum_variance_revenue / $aCount;
$avg_net_profit = $sum_variance_net_profit / $aCount;
$avg_pe_ratio_lyr = $sum_variance_pe_ratio_lyr / $aCount;
$avg_pe_ratio_ttm = $sum_variance_pe_ratio_ttm / $aCount;
$avg_pb_ratio = $sum_variance_pb_ratio / $aCount;
$avg_eps = $sum_variance_eps / $aCount;
$avg_net_asset_per = $sum_variance_net_asset_per / $aCount;
//计算偏离度
foreach ($aData as $k => $v) {
    $aData[$k]['deviate_lastest_price'] =($v['lastest_price']-$avg_lastest_price)/$avg_lastest_price;
    $aData[$k]['deviate_up_down'] =($v['up_down']-$avg_up_down)/$avg_up_down;
    $aData[$k]['deviate_1year_hightest'] =($v['1year_hightest']-$avg_1year_hightest)/$avg_1year_hightest;
    $aData[$k]['deviate_1year_lowest'] =($v['1year_lowest']-$avg_1year_lowest)/$avg_1year_lowest;
    $aData[$k]['deviate_1week_updown'] = ($v['1week_updown']-$avg_1week_updown)/$avg_1week_updown;
    $aData[$k]['deviate_4week_updown'] =($v['4week_updown']-$avg_4week_updown)/$avg_4week_updown;
    $aData[$k]['deviate_13week_updown'] =($v['13week_updown']-$avg_13week_updown)/$avg_13week_updown;
    $aData[$k]['deviate_52week_updown'] =($v['52week_updown']-$avg_52week_updown)/$avg_52week_updown;
    $aData[$k]['deviate_thisyear_updown'] =($v['thisyear_updown']-$avg_thisyear_updown)/$avg_thisyear_updown;
    $aData[$k]['deviate_current_bookvalue'] =($v['current_bookvalue']-$avg_current_bookvalue)/$avg_current_bookvalue;
    $aData[$k]['deviate_share'] =($v['share']-$avg_share)/$avg_share;
    $aData[$k]['deviate_revenue'] =($v['revenue']-$avg_revenue)/$avg_revenue;
    $aData[$k]['deviate_net_profit'] =($v['net_profit']-$avg_net_profit)/$avg_net_profit;
    $aData[$k]['deviate_pe_ratio_lyr'] =($v['pe_ratio_lyr']-$avg_pe_ratio_lyr)/$avg_pe_ratio_lyr;
    $aData[$k]['deviate_pe_ratio_ttm'] =($v['pe_ratio_ttm']-$avg_pe_ratio_ttm)/$avg_pe_ratio_ttm;
    $aData[$k]['deviate_pb_ratio'] =($v['pb_ratio']-$avg_pb_ratio)/$avg_pb_ratio;
    $aData[$k]['deviate_eps'] =($v['eps']-$avg_eps)/$avg_eps;
    $aData[$k]['deviate_net_asset_per'] = ($v['net_asset_per'] - $avg_net_asset_per) / $avg_net_asset_per;
}
//输出代码
foreach ($aData as $k => $v) {
    echo "<tr>
    <td>($v[0])<br>$v[1]</td>
    <td>". round($v[2], 2) ."</td>
    <td>". round($v[3], 4)*100 ."%</td>
    <td>". round($v[4], 2) ."</td>
    <td>". round($v[5]/10000, 2) ."</td>
    <td>". round($v[7], 2) ."</td>
    <td>". round($v[8], 2) ."</td>
    <td>". round($v[9], 2) ."</td>
    <td>". round($v[10], 2) ."</td>
    <td>". round($v[11], 2) ."</td>
    <td>". round($v[12], 2) ."</td>
    <td>". round($v[13], 2) ."</td>
    <td>". round($v[14], 2)."</td>
    <td>". round($v[15], 2)."</td>
    <td>". round($v[16], 2)."%</td>
    <td>". round($v[17], 2)."%</td>
    <td>". round($v[18], 2)."%</td>
    <td>". round($v[20], 2)."%</td>
    <td>". round($v[21], 2)."%</td>
    <td>". round($v[22], 2)."</td>
    <td>". round($v[23], 2)."</td>
    <td>". round($v[24], 2)."</td>
    <td>". round($v[25], 2)."</td>
    <td>". round($v[26], 2)."</td>
    <td>". round($v[27], 2)."</td>
    <td>". round($v[28], 2)."</td>
    <td>". round($v[29], 2)."</td>
    <td>". round($v[30], 2)."</td>
    <td>". round($v[31], 2)."</td>
    <td>". round($v[32], 2)."</td>
    <td>". round($v['deviate_lastest_price'], 4)*100 ."%</td>
    <td>". round($v['deviate_up_down'],4) ."%</td>
    <td>". round($v['deviate_1year_hightest'], 4)*100 ."%</td>
    <td>". round($v['deviate_1year_lowest'], 4)*100 ."%</td>
    <td>". round($v['deviate_1week_updown'], 4)*100 ."%</td>
    <td>". round($v['deviate_4week_updown'], 4)*100 ."%</td>
    <td>". round($v['deviate_13week_updown'], 4)*100 ."%</td>
    <td>". round($v['deviate_52week_updown'], 4)*100 ."%</td>
    <td>". round($v['deviate_thisyear_updown'], 4)*100 ."%</td>
    <td>". round($v['deviate_current_bookvalue'], 4)*100 ."%</td>
    <td>0</td>
    <td>". round($v['deviate_share'], 4)*100 ."%</td>
    <td>". round($v['deviate_revenue'], 4)*100 ."%</td>
    <td>". round($v['deviate_net_profit'], 4)*100 ."%</td>
    <td>". round($v['deviate_pe_ratio_lyr'], 4)*100 ."%</td>
    <td>". round($v['deviate_pe_ratio_ttm'], 4)*100 ."%</td>
    <td>". round($v['deviate_pb_ratio'], 4)*100 ."%</td>
    <td>". round($v['deviate_eps'], 4)*100 ."%</td>
    <td>". round($v['deviate_net_asset_per'], 4)*100 ."%</td>
  </tr>";
}
?>
</table>

</body>
</html>